<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  
  <link rel="shortcut icon" href="../img/favicon.ico">
  <title>为什么选择 Keras? - Keras 中文文档</title>
  <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" href="../css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
  
  <script>
    // Current page data
    var mkdocs_page_name = "\u4e3a\u4ec0\u4e48\u9009\u62e9 Keras?";
    var mkdocs_page_input_path = "why-use-keras.md";
    var mkdocs_page_url = "/zh/why-use-keras/";
  </script>
  
  <script src="../js/jquery-2.1.1.min.js" defer></script>
  <script src="../js/modernizr-2.8.3.min.js" defer></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script> 
  
  <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-61785484-1', 'keras.io');
      ga('send', 'pageview');
  </script>
  
</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
      <div class="wy-side-nav-search">
        <a href=".." class="icon icon-home"> Keras 中文文档</a>
        <div role="search">
  <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" title="Type search term here" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
	<ul class="current">
	  
          
            <li class="toctree-l1">
		
    <a class="" href="..">主页</a>
	    </li>
          
            <li class="toctree-l1 current">
		
    <a class="current" href="./">为什么选择 Keras?</a>
    <ul class="subnav">
            
    <li class="toctree-l2"><a href="#keras">为什么选择 Keras？</a></li>
    
        <ul>
        
            <li><a class="toctree-l3" href="#keras_1">Keras 优先考虑开发人员的经验</a></li>
        
            <li><a class="toctree-l3" href="#keras_2">Keras 被工业界和学术界广泛采用</a></li>
        
            <li><a class="toctree-l3" href="#keras_3">Keras 可以轻松将模型转化为产品</a></li>
        
            <li><a class="toctree-l3" href="#keras_4">Keras 支持多个后端引擎，不会将你锁定到一个生态系统中</a></li>
        
            <li><a class="toctree-l3" href="#keras-gpu">Keras 拥有强大的多 GPU 和分布式训练支持</a></li>
        
            <li><a class="toctree-l3" href="#keras_5">Keras 的发展得到深度学习生态系统中的关键公司的支持</a></li>
        
        </ul>
    

    </ul>
	    </li>
          
            <li class="toctree-l1">
		
    <span class="caption-text">快速开始</span>
    <ul class="subnav">
                <li class="">
                    
    <a class="" href="../getting-started/sequential-model-guide/">Sequential 顺序模型指引</a>
                </li>
                <li class="">
                    
    <a class="" href="../getting-started/functional-api-guide/">函数式 API 指引</a>
                </li>
                <li class="">
                    
    <a class="" href="../getting-started/faq/">FAQ 常见问题解答</a>
                </li>
    </ul>
	    </li>
          
            <li class="toctree-l1">
		
    <span class="caption-text">模型</span>
    <ul class="subnav">
                <li class="">
                    
    <a class="" href="../models/about-keras-models/">关于 Keras 模型</a>
                </li>
                <li class="">
                    
    <a class="" href="../models/sequential/">Sequential 顺序模型 API</a>
                </li>
                <li class="">
                    
    <a class="" href="../models/model/">函数式 API</a>
                </li>
    </ul>
	    </li>
          
            <li class="toctree-l1">
		
    <span class="caption-text">Layers</span>
    <ul class="subnav">
                <li class="">
                    
    <a class="" href="../layers/about-keras-layers/">关于 Keras 网络层</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/core/">核心网络层</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/convolutional/">卷积层 Convolutional</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/pooling/">池化层 Pooling</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/local/">局部连接层 Locally-connected</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/recurrent/">循环层 Recurrent</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/embeddings/">嵌入层 Embedding</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/merge/">融合层 Merge</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/advanced-activations/">高级激活层 Advanced Activations</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/normalization/">标准化层 Normalization</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/noise/">噪声层 Noise</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/wrappers/">层封装器 wrappers</a>
                </li>
                <li class="">
                    
    <a class="" href="../layers/writing-your-own-keras-layers/">编写你自己的层</a>
                </li>
    </ul>
	    </li>
          
            <li class="toctree-l1">
		
    <span class="caption-text">数据预处理</span>
    <ul class="subnav">
                <li class="">
                    
    <a class="" href="../preprocessing/sequence/">序列预处理</a>
                </li>
                <li class="">
                    
    <a class="" href="../preprocessing/text/">文本预处理</a>
                </li>
                <li class="">
                    
    <a class="" href="../preprocessing/image/">图像预处理</a>
                </li>
    </ul>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../losses/">损失函数 Losses</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../metrics/">评估标准 Metrics</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../optimizers/">优化器 Optimizers</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../activations/">激活函数 Activations</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../callbacks/">回调函数 Callbacks</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../datasets/">常用数据集 Datasets</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../applications/">应用 Applications</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../backend/">后端 Backend</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../initializers/">初始化 Initializers</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../regularizers/">正则化 Regularizers</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../constraints/">约束 Constraints</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../visualization/">可视化 Visualization</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../scikit-learn-api/">Scikit-learn API</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../utils/">工具</a>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="../contributing/">贡献</a>
	    </li>
          
            <li class="toctree-l1">
		
    <span class="caption-text">经典样例</span>
    <ul class="subnav">
                <li class="">
                    
    <a class="" href="../examples/addition_rnn/">Addition RNN</a>
                </li>
                <li class="">
                    
    <a class="" href="../examples/babi_rnn/">Baby RNN</a>
                </li>
                <li class="">
                    
    <a class="" href="../examples/babi_memnn/">Baby MemNN</a>
                </li>
                <li class="">
                    
    <a class="" href="../examples/cifar10_cnn/">CIFAR-10 CNN</a>
                </li>
                <li class="">
                    
    <a class="" href="../examples/cifar10_cnn_capsule/">CIFAR-10 CNN-Capsule</a>
                </li>
                <li class="">
                    
    <a class="" href="../examples/cifar10_cnn_tfaugment2d/">CIFAR-10 CNN with augmentation (TF)</a>
                </li>
                <li class="">
                    
    <a class="" href="../examples/cifar10_resnet/">CIFAR-10 ResNet</a>
                </li>
                <li class="">
                    
    <a class="" href="../examples/conv_filter_visualization/">Convolution filter visualization</a>
                </li>
                <li class="">
                    
    <a class="" href="../examples/image_ocr/">Image OCR</a>
                </li>
                <li class="">
                    
    <a class="" href="../examples/imdb_bidirectional_lstm/">Bidirectional LSTM</a>
                </li>
    </ul>
	    </li>
          
        </ul>
      </div>
      &nbsp;
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="..">Keras 中文文档</a>
      </nav>

      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="..">Docs</a> &raquo;</li>
    
      
    
    <li>为什么选择 Keras?</li>
    <li class="wy-breadcrumbs-aside">
      
        <a href="https://github.com/keras-team/keras-docs-zh/edit/master/docs/why-use-keras.md"
          class="icon icon-github"> Edit on GitHub</a>
      
    </li>
  </ul>
  <hr/>
</div>
          <div role="main">
            <div class="section">
              
                <h1 id="keras">为什么选择 Keras？</h1>
<p>在如今无数深度学习框架中，为什么要使用 Keras 而非其他？以下是 Keras 与现有替代品的一些比较。</p>
<hr />
<h2 id="keras_1">Keras 优先考虑开发人员的经验</h2>
<ul>
<li>
<p>Keras 是为人类而非机器设计的 API。<a href="https://blog.keras.io/user-experience-design-for-apis.html">Keras 遵循减少认知困难的最佳实践</a>: 它提供一致且简单的 API，它将常见用例所需的用户操作数量降至最低，并且在用户错误时提供清晰和可操作的反馈。</p>
</li>
<li>
<p>这使 Keras 易于学习和使用。作为 Keras 用户，你的工作效率更高，能够比竞争对手更快地尝试更多创意，从而<a href="https://www.quora.com/Why-has-Keras-been-so-successful-lately-at-Kaggle-competitions">帮助你赢得机器学习竞赛</a>。</p>
</li>
<li>
<p>这种易用性并不以降低灵活性为代价：因为 Keras 与底层深度学习语言（特别是 TensorFlow）集成在一起，所以它可以让你实现任何你可以用基础语言编写的东西。特别是，<code>tf.keras</code> 作为 Keras API 可以与 TensorFlow 工作流无缝集成。</p>
</li>
</ul>
<hr />
<h2 id="keras_2">Keras 被工业界和学术界广泛采用</h2>
<p><img src='https://s3.amazonaws.com/keras.io/img/dl_frameworks_power_scores.png' style='width:500px; display: block; margin: 0 auto;'/></p>
<p style='font-style: italic; font-size: 10pt; text-align: center;'>
    Deep learning 框架排名，由 Jeff Hale 基于 7 个分类的 11 个数据源计算得出
</i>
</p>

<p>截至 2018 年中期，Keras 拥有超过 250,000 名个人用户。与其他任何深度学习框架相比，Keras 在行业和研究领域的应用率更高（除 TensorFlow 之外，且 Keras API 是 TensorFlow 的官方前端，通过 <code>tf.keras</code> 模块使用）。</p>
<p>您已经不断与使用 Keras 构建的功能进行交互 - 它在 Netflix, Uber, Yelp, Instacart, Zocdoc, Square 等众多网站上使用。它尤其受以深度学习作为产品核心的创业公司的欢迎。</p>
<p>Keras也是深度学习研究人员的最爱，在上载到预印本服务器 <a href="https://arxiv.org/archive/cs">arXiv.org</a> 的科学论文中被提及的次数位居第二。Keras 还被大型科学组织的研究人员采用，特别是 CERN 和 NASA。</p>
<hr />
<h2 id="keras_3">Keras 可以轻松将模型转化为产品</h2>
<p>与任何其他深度学习框架相比，你的 Keras 模型可以在更广泛的平台上轻松部署：</p>
<ul>
<li>在 iOS 上，通过 <a href="https://developer.apple.com/documentation/coreml">Apple’s CoreML</a>（苹果为 Keras 提供官方支持）。这里有一个<a href="https://www.pyimagesearch.com/2018/04/23/running-keras-models-on-ios-with-coreml/">教程</a>。</li>
<li>在 Android 上，通过 TensorFlow Android runtime，例如：<a href="https://medium.com/@timanglade/how-hbos-silicon-valley-built-not-hotdog-with-mobile-tensorflow-keras-react-native-ef03260747f3">Not Hotdog app</a>。</li>
<li>在浏览器中，通过 GPU 加速的 JavaScript 运行时，例如：<a href="https://transcranial.github.io/keras-js/#/">Keras.js</a> 和 <a href="https://mil-tokyo.github.io/webdnn/">WebDNN</a>。</li>
<li>在 Google Cloud 上，通过 <a href="https://www.tensorflow.org/serving/">TensorFlow-Serving</a>。</li>
<li><a href="https://blog.keras.io/building-a-simple-keras-deep-learning-rest-api.html">在 Python webapp 后端（比如 Flask app）中</a>。</li>
<li>在 JVM 上，通过 <a href="https://deeplearning4j.org/model-import-keras">SkyMind 提供的 DL4J 模型导入</a>。</li>
<li>在 Raspberry Pi 树莓派上。</li>
</ul>
<hr />
<h2 id="keras_4">Keras 支持多个后端引擎，不会将你锁定到一个生态系统中</h2>
<p>你的 Keras 模型可以基于不同的<a href="https://keras.io/zh/backend/">深度学习后端</a>开发。重要的是，任何仅利用内置层构建的 Keras 模型，都可以在所有这些后端中移植：你可以用一种后端训练模型，再将它载入另一种后端中（例如为了发布的需要）。支持的后端有：</p>
<ul>
<li>谷歌的 TensorFlow 后端</li>
<li>微软的 CNTK 后端</li>
<li>Theano 后端</li>
</ul>
<p>亚马逊也正在为 Keras 开发 MXNet 后端。</p>
<p>如此一来，你的 Keras 模型可以在 CPU 之外的不同硬件平台上训练：</p>
<ul>
<li><a href="https://developer.nvidia.com/deep-learning">NVIDIA GPU</a></li>
<li><a href="https://cloud.google.com/tpu/">Google TPU</a>，通过 TensorFlow 后端和 Google Cloud</li>
<li>OpenCL 支持的 GPU, 比如 AMD, 通过 <a href="https://github.com/plaidml/plaidml">PlaidML Keras 后端</a></li>
</ul>
<hr />
<h2 id="keras-gpu">Keras 拥有强大的多 GPU 和分布式训练支持</h2>
<ul>
<li>Keras <a href="https://keras.io/zh/utils/#multi_gpu_model">内置对多 GPU 数据并行的支持</a>。</li>
<li>优步的 <a href="https://github.com/uber/horovod">Horovod</a> 对 Keras 模型拥有一流的支持。</li>
<li>Keras 模型<a href="https://www.tensorflow.org/versions/master/api_docs/python/tf/keras/estimator/model_to_estimator">可以被转换为 TensorFlow Estimators</a> 并在 <a href="https://cloud.google.com/solutions/running-distributed-tensorflow-on-compute-engine">Google Cloud 的 GPU 集群</a>上训练。</li>
<li>Keras 可以在 Spark（通过 CERN 的 <a href="https://github.com/cerndb/dist-keras">Dist-Keras</a>）和 <a href="https://github.com/maxpumperla/elephas">Elephas</a> 上运行。</li>
</ul>
<hr />
<h2 id="keras_5">Keras 的发展得到深度学习生态系统中的关键公司的支持</h2>
<p>Keras 的开发主要由谷歌支持，Keras API 以 <code>tf.keras</code> 的形式包装在 TensorFlow 中。此外，微软维护着 Keras 的 CNTK 后端。亚马逊 AWS 正在开发 MXNet 支持。其他提供支持的公司包括 NVIDIA、优步、苹果（通过 CoreML）等。</p>
<p><img src='/img/google-logo.png' style='width:200px; margin-right:15px;'/>
<img src='/img/microsoft-logo.png' style='width:200px; margin-right:15px;'/>
<img src='/img/nvidia-logo.png' style='width:200px; margin-right:15px;'/>
<img src='/img/aws-logo.png' style='width:110px; margin-right:15px;'/></p>
              
            </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../getting-started/sequential-model-guide/" class="btn btn-neutral float-right" title="Sequential 顺序模型指引">Next <span class="icon icon-circle-arrow-right"></span></a>
      
      
        <a href=".." class="btn btn-neutral" title="主页"><span class="icon icon-circle-arrow-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <!-- Copyright etc -->
    
  </div>

  Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
      
        </div>
      </div>

    </section>

  </div>

  <div class="rst-versions" role="note" style="cursor: pointer">
    <span class="rst-current-version" data-toggle="rst-current-version">
      
          <a href="https://github.com/keras-team/keras-docs-zh/" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
      
      
        <span><a href=".." style="color: #fcfcfc;">&laquo; Previous</a></span>
      
      
        <span style="margin-left: 15px"><a href="../getting-started/sequential-model-guide/" style="color: #fcfcfc">Next &raquo;</a></span>
      
    </span>
</div>
    <script>var base_url = '..';</script>
    <script src="../js/theme.js" defer></script>
      <script src="../search/main.js" defer></script>

</body>
</html>
